Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 44b7dc1657b62de9a2866b0175c65f6cffa07aca


Parents : 4a6ab03
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-01T19:53:38-06:00

feat(auth): add global axios interceptor for handling authentication errors and redirecting to the auth page; introduce new identities page for managing user identities

Changes

2 files changed, 20 insertions(+), 1 deletions(-)


Diff

diff --git a/meshchatx/src/frontend/js/WebSocketConnection.js b/meshchatx/src/frontend/js/WebSocketConnection.js
index 54557378..434a5937 100644
--- a/meshchatx/src/frontend/js/WebSocketConnection.js
+++ b/meshchatx/src/frontend/js/WebSocketConnection.js
@@ -19,7 +19,7 @@ class WebSocketConnection {
try {
const response = await window.axios.get("/api/v1/app/info");
this.isDemoMode = response.data.app_info?.is_demo === true;
- } catch (e) {
+ } catch {
// If we can't check, assume not demo mode and try to connect
}

diff --git a/meshchatx/src/frontend/main.js b/meshchatx/src/frontend/main.js
index db36da18..cf4e3334 100644
--- a/meshchatx/src/frontend/main.js
+++ b/meshchatx/src/frontend/main.js
@@ -31,6 +31,20 @@ const vuetify = createVuetify();
// provide axios globally
window.axios = axios;
+// setup global axios interceptor for auth errors
+axios.interceptors.response.use(
+ (response) => response,
+ (error) => {
+ if (error.response?.status === 401 || error.response?.status === 403) {
+ // only redirect if we're not already on the auth page
+ if (router.currentRoute.value.name !== "auth") {
+ router.push("/auth");
+ }
+ }
+ return Promise.reject(error);
+ }
+);
+
const router = createRouter({
history: createWebHashHistory(),
routes: [
@@ -152,6 +166,11 @@ const router = createRouter({
path: "/settings",
component: defineAsyncComponent(() => import("./components/settings/SettingsPage.vue")),
},
+ {
+ name: "identities",
+ path: "/identities",
+ component: defineAsyncComponent(() => import("./components/settings/IdentitiesPage.vue")),
+ },
{
name: "blocked",
path: "/blocked",


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────